using System;
using System.Collections.Generic;
using System.Text;

namespace Objects
{
    public class ChuDe
    {
        #region ChuDe variables

        private int _Id;
        private String _TenChuDe;
        private String _DuongDan;
        private String _GhiChu;

        private int _Status;
        private int _SapXep;

        #endregion

        #region ChuDe properties

        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }

        public String TenChuDe
        {
            get { return _TenChuDe; }
            set { _TenChuDe = value; }
        }

        public String DuongDan
        {
            get { return _DuongDan; }
            set { _DuongDan = value; }
        }

        public String GhiChu
        {
            get { return _GhiChu; }
            set { _GhiChu = value; }
        }

        public int Status
        {
            get { return _Status; }
            set { _Status = value; }
        }

        public int SapXep
        {
            get { return _SapXep; }
            set { _SapXep = value; }
        }

        #endregion

        #region IPopulatable<ChuDe> Members

        public ChuDe Populate(System.Data.DataRow reader)
        {
            ChuDe item = new ChuDe();

            try { item.Id = Convert.ToInt32(reader["Id"].ToString()); }
            catch { item.Id = -1; }

            item.TenChuDe = Convert.ToString(reader["TenChuDe"].ToString());
            item.DuongDan = Convert.ToString(reader["DuongDan"].ToString());
            try
            {
                item.GhiChu = Convert.ToString(reader["GhiChu"].ToString());
            }
            catch { item.GhiChu = ""; }
          
            item.Status = Convert.ToInt32(reader["Status"].ToString());
            item.SapXep = Convert.ToInt32(reader["SapXep"].ToString());

            return item;
        }

        #endregion
    }
}
